var fastmail = document.getElementById("fastmail");
var fastCode = document.getElementById("fastCode");

var xhr;

fastmail.onchange=createFastCode;

function createFastCode(){
    xhr = new XMLHttpRequest();
    xhr.onreadystatechange = processCreate;
    xhr.open("GET","/order/getFastCode",true);
    xhr.send(null);
}

function processCreate(){
    if(xhr.readyState == 4){
        if(xhr.status == 200){
            var str = xhr.responseText;
            fastCode.value=str;
        }
    }
}
$(document).ready(function () {
    $("#editItemTable").submit(function () {
        if(fastCode.value == ""){
            alert("请选择快递类型");
            fastmail.focus();
            return false;
        }
        return true;
    })
})
